<?php

/**
 * SweetPHP <br />
 * <p><b>ExampleModel</b></p>
 * @package SweetPHP
 * @package Apps/Model/Examples
 * @author sweetphp
 * <p>Exemplo de model, objeto<p><br />
 */

/** @Table("User") */
class User extends Model {

    /** @Column("{'name':'id', 'type':'int','length':11, 'primaryKey':true}") */
    public $id = 0;

    /** @Column("{'name':'mail', 'type':'varchar', 'length':'20', 'unique':'true', 'nullable':'false'}") */
    public $mail;
    
    /** @Column("{'name':'login', 'type':'varchar', 'length':'50', 'nullable':'false'}") */
    public $login;

    /** @Column("{'name':'password', 'type':'varchar','length':'255', 'unique':'true', 'nullable':'false'}") */
    public $password;

    /** @JoinColumn("{'name':'people', 'referencedColumnName':'id'"}) */
    public $people;

    public function __construct() {
        $this->id = -1;
        $this->mail = "";
        $this->login = "";
        $this->password = "";
        $this->people = new People();
        parent::__construct();
    }

    public function construct($id = 0, $mail = "", $password = "", People $people = null, $login = "") {
        $this->id = $id;
        $this->mail = $mail;
        $this->password = $password;
        $this->people = $people;
        $this->login = $login;
    }

    public function getId() {
        return $this->id;
    }

    public function getMail() {
        return $this->mail;
    }

    public function getPassword() {
        return $this->password;
    }

    public function setId($var = 0) {
        $this->id = $var;
    }

    public function setMail($var = "") {
        $this->mail = $var;
    }

    public function setPassword($var = "") {
        $this->password = $var;
    }

    public function getPeople() {
        return $this->people;
    }

    public function setPeople(People $var = null) {
        $this->people = $var;
    }

    public function getLogin() {
        return $this->login;
    }

    public function setLogin($var = null) {
        $this->login = $var;
    }
    
//    public function __get($key) {
//      // return value of _userID for UserID property
//    }    
//    
//    public function __set($name, $value) {
//        $this->$name = $value;
//    }
    

}
